home *** CD-ROM | disk | FTP | other *** search
-
-
-
- BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333)))) 22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222)))) BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))
-
-
-
- NNNNAAAAMMMMEEEE
- B::Deparse - Perl compiler backend to produce perl code
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ppppeeeerrrrllll ----MMMMOOOO====DDDDeeeeppppaaaarrrrsssseeee[,,,,----uuuu_P_A_C_K_A_G_E][,,,,----pppp][,,,,----llll][,,,,----ssss_L_E_T_T_E_R_S] _p_r_o_g._p_l
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- B::Deparse is a backend module for the Perl compiler that
- generates perl source code, based on the internal compiled
- structure that perl itself creates after parsing a program.
- The output of B::Deparse won't be exactly the same as the
- original source, since perl doesn't keep track of comments
- or whitespace, and there isn't a one-to-one correspondence
- between perl's syntactical constructions and their compiled
- form, but it will often be close. When you use the ----pppp
- option, the output also includes parentheses even when they
- are not required by precedence, which can make it easy to
- see if perl is parsing your expressions the way you
- intended.
-
- Please note that this module is mainly new and untested code
- and is still under development, so it may change in the
- future.
-
- OOOOPPPPTTTTIIIIOOOONNNNSSSS
- As with all compiler backend options, these must follow
- directly after the '-MO=Deparse', separated by a comma but
- not any white space.
-
- ----pppp Print extra parentheses. Without this option, B::Deparse
- includes parentheses in its output only when they are
- needed, based on the structure of your program. With ----pppp,
- it uses parentheses (almost) whenever they would be
- legal. This can be useful if you are used to LISP, or if
- you want to see how perl parses your input. If you say
-
- if ($var & 0x7f == 65) {print "Gimme an A!"}
- print ($which ? $a : $b), "\n";
- $name = $ENV{USER} or "Bob";
-
- B::Deparse,-p will print
-
- if (($var & 0)) {
- print('Gimme an A!')
- };
- (print(($which ? $a : $b)), '???');
- (($name = $ENV{'USER'}) or '???')
-
- which probably isn't what you intended (the '???' is a
- sign that perl optimized away a constant value).
-
-
-
-
-
- Page 1 (printed 10/23/98)
-
-
-
-
-
-
- BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333)))) 22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222)))) BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))
-
-
-
- ----uuuu_P_A_C_K_A_G_E
- Normally, B::Deparse deparses the main code of a
- program, all the subs called by the main program (and
- all the subs called by them, recursively), and any other
- subs in the main:: package. To include subs in other
- packages that aren't called directly, such as AUTOLOAD,
- DESTROY, other subs called automatically by perl, and
- methods, which aren't resolved to subs until runtime,
- use the ----uuuu option. The argument to ----uuuu is the name of a
- package, and should follow directly after the 'u'.
- Multiple ----uuuu options may be given, separated by commas.
- Note that unlike some other backends, B::Deparse doesn't
- (yet) try to guess automatically when ----uuuu is needed --
- you must invoke it yourself.
-
- ----llll Add '#line' declarations to the output based on the line
- and file locations of the original code.
-
- ----ssss_L_E_T_T_E_R_S
- Tweak the style of B::Deparse's output. At the moment,
- only one style option is implemented:
-
- CCCC Cuddle elsif, else, and continue blocks. For
- example, print
-
- if (...) {
- ...
- } else {
- ...
- }
-
- instead of
-
- if (...) {
- ...
- }
- else {
- ...
- }
-
- The default is not to cuddle.
-
- BBBBUUUUGGGGSSSS
- See the 'to do' list at the beginning of the module file.
-
- AAAAUUUUTTTTHHHHOOOORRRR
- Stephen McCamant <alias@mcs.com>, based on an earlier
- version by Malcolm Beattie <mbeattie@sable.ox.ac.uk>.
-
-
-
-
-
-
-
- Page 2 (printed 10/23/98)
-
-
-
-
-
-
- BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333)))) 22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222)))) BBBB::::::::DDDDeeeeppppaaaarrrrsssseeee((((3333))))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 3 (printed 10/23/98)
-
-
-
-
-
-
-